<template>
	<view class="container-root">
		<view class="section" v-for="(item,index) in dataList" :key="index">
			<view class="content">
				<view class="content-left">
					<image v-if="item.imgLoaded" :src="getImagUlr(item.imageUrl)" mode="scaleToFill" ></image>
					<image v-if="!item.imgLoaded" src="/static/images/load_fial_image.png" mode="scaleToFill" ></image>
					
				</view>
				<view class="content-right">
					<view class="content-right-top">
						<text>{{item.productName}}</text>
					</view>
					<view class="content-money">
						<view class="content-money-left">
							<view class="money">￥{{item.pricePerMonth}}/月</view>
							<text>主机</text>
						</view>
						<view class="money1">
							<text>副机</text>
							<view>￥{{item.subPricePerMonth}}/月</view>
						</view>
					</view>
					<view class="buynum">
						<text>购买月数：</text>
						<view class="update-count">
							<view class="reduce" @tap="reduce(item.productId)">
								-
							</view>
							<view class="cart-count">
								{{item.count}}
							</view>
							<view class="Add" @tap="add(item.productId)">
								+
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="title">
			<text>选择终端</text>
			<radio-group @change="radioChange">
				<label class="title-chose" v-for="(item,index) in terminalList" :key="index">
					<text>{{item.stbno}}</text>
					<view class="title-chose-right">
						<text v-if="item.mothercardflag==0">主机</text><text v-if="item.mothercardflag== 1">副机</text>
						<text v-if="item.cardflag==0">高清</text><text v-if="item.cardflag== 1">标清</text>
					</view>
					<view>
						<checkbox :value="item.stbno" :checked="index === current" />
					</view>
				</label>
			</radio-group>
		</view>
		<view class="already">
			<text>已购产品</text>
			<view v-if="hasprotect" class="noprotect">
				<text>该终端尚未购买任何产品包</text>
			</view>
			<view class="" v-if="!hasprotect" v-for="(item,index) in boughtList" :key="index">
				<view class="buycontent">
					<text class="buycontent-left">{{item.productname}}</text>
					<text class="buycontent-right">{{item.endtime}}</text>
				</view>
			</view>
		</view>
		<view class="bottom">
			<view class="bottom-left">
				<text class="add">合计:</text>
				<text class="allmoney">￥{{cartTotalPrice}}</text>
			</view>
			<view class="bottom-right" @tap="ensure">
				提交订单
			</view>
		</view>
		<uni-popup ref="popup" type="bottom">
			<view class="paywindow-root">				
				<view class="paywindow-title">
					<view class="paywindow-title-cancel" @tap="onClosePayWindow()">
						<image class="image-cancel" src="../../static/images/cancel.png"></image>
					</view>
					<view class="paywindow-title-text">
						确认付款
					</view>
				</view>
				<view class="line"></view>
				<view class="paywindow-content">
					<view class="paywindow-content-price">
						￥{{cartTotalPrice}}
					</view>
					<view class="paywindow-content-list">
						<view class="content-tag">订单号</view>
						<view class="content-order">{{orderId}} </view>
					</view>
					<view class="paywindow-content-list">
						<view class="content-tag">下单时间</view>
						<view class="content-order">{{orderTime}} </view>
					</view>
				</view>
				<view class="paywindow-submit" hover-class='paywindow-button-hover' hover-stay-time='50' @tap="onSubmitPay">
					<text>确认付款</text>
				</view>							
			</view>
		</uni-popup>
	</view>
</template>

<script>
	import apis from '../../api.js'
	import httpRequest from '@/utils/utilHttp.js'
	import uniPopup from '@/components/uni-popup/uni-popup.vue'
	import uniPopupMessage from '@/components/uni-popup/uni-popup-message.vue'
	import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
	
	import {
		mapState
	} from 'vuex' //导入vuex的mapState和mapMutations方法
	export default {
		components: {
			uniPopup,
			uniPopupMessage,
			uniPopupDialog
		},
		data() {
			return {
				hasprotect: '',				
				money: '',
				current: 0,
				boughtList: [],
				
				userType: '',
				terminalList: [],
				dataList: [],
				productImages:{},
				imageObj:{
					path:'/static/images/load_fial_image.png',
					imgLoaded:false
				},
				orderId: '',
				orderTime:'',
				code:'',
				priceTotal: 0.00, // 总价
				productBuyInfos: null,
				payMoneySuccess:false,
				activityProductPosition: -1, //是否有活动包
				giveProductPosition: -1, // 是否包含赠送包
				isShoppingAddingGive: false, // 是否购物车添加（购物车添加的赠送包的话，当不满足活动要求时也得显示，不能删除掉）
			}
		},
		computed: {
			...mapState(['userInfo','token']), //对全局变量进行监控
			
			cartTotalPrice() {
				// 计算list列表中所有选中商品的价格
				var sum = 0
				this.dataList.forEach(el => {
					sum = Number(el.price) + Number(sum)
				})
				sum = this.toDecimal2(sum)
				// console.log(sum)
				return sum
			}
		},
		onLoad(option) {
			console.log('enSureOrder loading------')
			var that = this
			uni.login({
				provider: 'weixin',
				success: function(loginRes) {
					// 获取用户信息
					console.log(loginRes)
					that.code=loginRes.code
					console.log(that.code)					
				}
			});
			that.userType = that.userInfo.userType;			
			if (that.userInfo.userType === '0') {
				that.terminalList = that.userInfo.stbInfo
			}else{
				that.terminalList.push(that.userInfo.unauthorizedSize)
				that.terminalList.push(that.userInfo.authorizedSize)
			}

			var productData = JSON.parse(option.productDatas)
			that.dataList = productData
			
			console.log(productData)
			for (let i = 0; i < that.dataList.length; i++) {
				that.dataList[i]['count'] = "1"
				that.dataList[i].price = that.dataList[i].pricePerMonth * that.dataList[i]['count']
				that.dataList[i].imgLoaded = that.firstLoadImagUlr(that.dataList[i].imageUrl)
			}
			console.log(that.dataList)
			that.checkActivity(true)
			that.getBuyInfo(0)
		},
		onShow() {
			// var that = this
			// apis.Productinfochao({
			// 	"userCode": this.userInfo.userCode,
			// 	"terminalid": that.terminalList[0].stbno
			// }).then(res => {
			// 	//console.log(res)
			// 	if (res[1].data.content.length == 0&&res[1].data.status==40101) {
			// 		that.hasprotect = true
			// 	} else {
			// 		that.hasprotect = false
			// 		that.boughtList = res[1].data.content
			// 	}
			// })
		},
		methods: {
			toDecimal2(x) {
			  var f = parseFloat(x);
			  if (isNaN(f)) {
			    return false;
			  }
			  var f = Math.round(x * 100) / 100;
			  var s = f.toString();
			  var rs = s.indexOf('.');
			  if (rs < 0) {
			    rs = s.length;
			    s += '.';
			  }
			  while (s.length <= rs + 2) {
			    s += '0';
			  }
			  return s;
			},
			firstLoadImagUlr(icon){
				var self = this;
				var iconObj={path:'',loaded:false};
				iconObj.path = '/static/images/load_fial_image.png'; 
				iconObj.loaded = false;
				
				var tempImagePath = uni.getStorageSync('tempImagePath');
				if (tempImagePath && tempImagePath[icon]) {
					iconObj.path = tempImagePath[icon];
					iconObj.loaded = true;										
				} 
				else {
					let options = {
						url:httpRequest.requestUrl.imageUrl + icon						
					};
					
					httpRequest.DownloadFile(options).then(res => {						
						if(res.statusCode == 200){							
							var tempImagePath = uni.getStorageSync('tempImagePath');
							if (tempImagePath && tempImagePath[icon]) {								
							    iconObj.path = tempImagePath[icon];
							    iconObj.loaded = true;	
								for(var i=0; i< self.dataList.length; i++){
									if(self.dataList[i].imageUrl == icon){
										self.dataList[i].imgLoaded = true;
										break;
									}
								}																	
							}							
						}						
					})
				}
				if(!self.productImages[icon])
				{
					self.productImages[icon] = iconObj;
				}
				if(self.productImages[icon].path != iconObj.path)
				{
					self.productImages[icon].path = iconObj.path;
				}
				if(self.productImages[icon].loaded != iconObj.loaded)
				{
					self.productImages[icon].loaded = iconObj.loaded;
				}
				return self.productImages[icon].loaded;
			},
			// 增加商品数量
			getImagUlr(icon){
				console.log('图片获取...')
				var self = this;
				var iconObj={path:'',loaded:false};
				iconObj.path = '/static/images/load_fial_image.png'; 
				iconObj.loaded = false;
				var tempImagePath = uni.getStorageSync('tempImagePath');
				if (tempImagePath && tempImagePath[icon]) {
					iconObj.path = tempImagePath[icon];
					iconObj.loaded = true;
				}
				if(!self.productImages[icon])
				{
					self.productImages[icon] = iconObj;
				}	
				return self.productImages[icon].path;				
			},
			add(id) {
				this.dataList.forEach(el => {
					if (el.productId == id) {
						el.count++
						// 商品小计价格也要改变
						el.price = el.count * el.pricePerMonth
					}
				})

			},
			getOrderID:function (date) {
				var that = this				
				var orderCode;
				
				if (that.userInfo.userCode) {
				  orderCode = (parseInt(that.userInfo.userCode) + date.getTime()).toString()
				} else {
				  orderCode = date.getTime().toString()
				}
				var orderId = 'ORDER_' + orderCode.substring(2, orderCode.length)
				return orderId;
			},
			formatDate:function(time,format='YY-MM-DD hh:mm:ss'){
				var date = new Date(time);
				var year = date.getFullYear(),
				        month = date.getMonth()+1,//月份是从0开始的
				        day = date.getDate(),
				        hour = date.getHours(),
				        min = date.getMinutes(),
				        sec = date.getSeconds();
				    var preArr = Array.apply(null,Array(10)).map(function(elem, index) {
				        return '0'+index;
				    });
				var newTime = format.replace(/YY/g,year)
				        .replace(/MM/g,preArr[month]||month)
				        .replace(/DD/g,preArr[day]||day)
				        .replace(/hh/g,preArr[hour]||hour)
				        .replace(/mm/g,preArr[min]||min)
				        .replace(/ss/g,preArr[sec]||sec);
				 
				    return newTime;	
			},
			getBillItems: function(that, date) {
				var that = this
			    var billItems = []
			    var productDatas = that.dataList
			    for (var i = 0; i < productDatas.length; i++) {
			      // if (this.data.activityProductPosition != -1 && productDatas[i].productId === "9" && that.stbInfos[that.data.boxPosition].mothercardflag === '0' && that.userType === "0" && (!that.data.countNumbers || that.data.countNumbers[that.data.activityProductPosition] >= 24)) {
			      //   continue
			      // }
			      var params = {
			        id: productDatas[i].productId,
			        productname: productDatas[i].productName,
			        type: '1',
			        buytype: 'buyproduct',
			        totalmoney: productDatas[i].price,
			        starttime: date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate(),
			        endtime: '',
			        unit: 'month',
			        buyamount: productDatas[i].count || 12,
			      }
			      billItems.push(params)
			    }
			    return billItems
			},
			createOrder:function(){
				var that = this;
				console.log('createOrder....')
				var url
				var that = this
				var date = new Date();
				var orderId = that.getOrderID(date);
				that.orderId = orderId;
				that.orderTime = that.formatDate(new Date().getTime(),'YY/MM/DD hh:mm:ss');
				that.calcPriceTotal()
				console.log(orderId)
				console.log(that.orderTime);
				
				var billInfo = {
					source: '1', //0-营业厅，1-mps，2-代买
					buyerid: that.userInfo.userCode,
					terminalid: that.terminalList[0].stbno,
					terminaltype: that.terminalList[0].type === "2" ? "0" : "1",
					totalMoney: '' + that.priceTotal,
					payMoney: '' + that.priceTotal,
					billDetail: that.getBillItems(that, date),
				}
				console.log(billInfo)
				var params = {
					userCode: that.userInfo.userCode,
					token: that.token,
					orderId: orderId,
					billInfo: JSON.stringify(billInfo),
					type: 0, //购买方式  0-未授权终端购买 1-已授权终端购买
				}

				if (that.userType === '0')				
					url = httpRequest.requestUrl.createOrder_post
				else
					url = httpRequest.requestUrl.createGroupOrder_post
					
				let options = {
					url:url,
					method:httpRequest.requestMethod.POST,
					datas:params
				};	
				httpRequest.Request(options).then(res => {
					console.log(res)				
					if (res.data.status == 200) {
						this.onOpenPayWindow()
					}else{
						uni.showToast({
							title: '创建订单失败',
							icon: 'none'
						})
					}				
				})				
			},
			onOpenPayWindow(){
				this.$refs.popup.open();
			},
			onClosePayWindow(){
				this.$refs.popup.close();
			},
			ensure(){
				this.createOrder();				
			},
			reduce(id) {
				this.dataList.forEach(el => {
					if (el.count > 1) {
						if (el.productId == id) {
							el.count--
							// 商品小计价格也要改变
							el.price = el.count * el.pricePerMonth
						}
					} else {
						uni.showToast({
							title: '至少购买一件商品',
							icon: 'none'
						})
					}
				})

			},
			onSubmitPay(){
				if (this.priceTotal === '0.00') {
					this.checkPayPwd()
				} else {
					this.placeAnOrder()
				}
				
			},
			radioChange: function(evt) {
				//console.log(evt)
				if (evt.target.value == '') {
					var that = this
					apis.Productinfochao({
						"userCode": this.userInfo.userCode
					}).then(res => {
						//console.log(res)
						if (res[1].data.content.length == 0) {
							that.hasprotect = true
						} else {
							that.hasprotect = false
							that.boughtList = res[1].data.content
						}
					})
				} else {
					for (let i = 0; i < this.terminalList.length; i++) {
						if (this.terminalList[i].stbno === evt.target.value) {
							this.current = i;
							var that = this
							apis.Productinfochao({
								"userCode": this.userInfo.userCode,
								"terminalid": that.terminalList[i].stbno
							}).then(res => {
								//console.log(res)
								if (res[1].data.content.length == 0) {
									that.hasprotect = true
								} else {
									that.hasprotect = false
									that.boughtList = res[1].data.content
								}
							})
							break;
						}
					}
				}
			},
			checkActivity: function(isFrist) {
				var that = this
				var productDatas = that.dataList
				var isShoppingAddingGive = that.isShoppingAddingGive
				var activityProductPosition = -1
				var giveProductPosition = -1
				if (isShoppingAddingGive) 
					return
				for (var i = 0; i < productDatas.length; i++) {
					if (productDatas[i].productId === "1") { // 是否包含活动包
						activityProductPosition = i
					} else if (productDatas[i].productId === "9") { // 是否包含赠送包
						giveProductPosition = i
					}
					if (activityProductPosition != -1 && giveProductPosition != -1) {
						break
					}						
				}
				if (activityProductPosition != -1 && giveProductPosition == -1) { //添加赠送包
					var productList = uni.getStorageSync("productList")
					for (var i = 0; i < productList.length; i++) {
						if (productList[i].productId === "9") {
							productDatas.push(productList[i])
							giveProductPosition = productDatas.length - 1
							break
						}
					}
				} else if (activityProductPosition != -1 && giveProductPosition != -1 && isFrist) {
					isShoppingAddingGive = true
				}
				that.activityProductPosition = activityProductPosition
				that.giveProductPosition = giveProductPosition
				that.isShoppingAddingGive = isShoppingAddingGive
				that.dataList = productDatas
			},
			getBuyInfo: function(boxPosition) {
				var self = this;
				if(self.userType === '1'){
					return;
				}
				var params = {
					userCode: self.userInfo.userCode,
					userlevel: self.userInfo.userLevel,
					token: self.token,
					nitId: self.userInfo.netId,
					terminalid: self.userInfo.stbInfo[0].stbno,
				};
				let options = {
					url:httpRequest.requestUrl.productBuyInfo_get,
					method:httpRequest.requestMethod.GET,
					datas:params
				};
				
				httpRequest.Request(options).then(res => {
					
					console.log(res)
					var productBuyInfos = [];
					if (res.data.status == 200) {						
						productBuyInfos = res.data.content;												
					}
					self.productBuyInfos = productBuyInfos;
					// 支付成功后
					if(self.payMoneySuccess){
						var productBuyResult = [];
						for(var i = 0; i < productBuyInfos.length; i++){
							for (var j = 0; j < self.dataList.length; j++) {
								if (self.dataList[j].productId === productBuyInfos[i].productid) {
									productBuyResult.push(productBuyInfos[i])
								}
							}
						}
						uni.redirectTo({
							url: '/pages/ensureorder/pay-result/pay-result?payMoney=' + self.priceTotal + '&productBuyResult=' + JSON.stringify(productBuyResult),
						})
					}
				})
			},
			calcPriceTotal: function() {
				var that = this;
				var sum = 0
				that.dataList.forEach(el => {
					sum = Number(el.price) + Number(sum)
				})
				//console.log(sum)
				
				that.priceTotal = sum			    
			},
			checkPayPwd: function() {
			    var that = this
			    var param = {
			      userCode: that.userInfo.userCode,
			      payPwd: "123456",
			      orderId: that.orderId,
			      token: that.userInfo.token,
			    }
				let options = {
					url:httpRequest.requestUrl.checkPayPwd_post,
					method:httpRequest.requestMethod.POST,
					datas:param
				}
				httpRequest.Request(options).then(res => {
					console.log(res)
					that.payComplete(that, true, res)
				})
			},
			placeAnOrder: function() {
				var that = this
				var params = {
				  code: that.code,
				  userCode: that.userInfo.userCode,
				  token: that.token,
				  orderId: that.orderId,
				  actualPay: that.priceTotal, // 金额
				  AppPayType: "2", // 小程序
				}
				let options = {
					url:httpRequest.requestUrl.placeAnOrder_post,
					method:httpRequest.requestMethod.POST,
					datas:params
				}
				httpRequest.Request(options).then(res => {
					console.log(res)
					that.payComplete(that, false, res.data)
				})				
			},
			
			payComplete: function(that, isZeroBuy, result) {
			    var errMessage = "购买失败！"
			    if (result.status === '200') {
					if (isZeroBuy) {
						that.paySuccess(that)
					} else {
						that.requestWechatPayment(result.content)
					}
			    } else {
					this.onClosePayWindow();
					if (result.status === '40120') {
						errMessage = "购买失败，支付金额有误！"
					} else if (result.status === '40128') {
						errMessage = "付费包的授权结束时间超过基本包购买时间！"
					} else if (result.status === '40129') {
						errMessage = "购买失败，请购买基本包后再尝试！"
					} else if (result.status === '40130') {
						errMessage = "购买失败，请为主卡购买基本包后再尝试"
					} else if (result.status === '40131') {
						errMessage = "子卡购买基本包的授权时间超过主卡购买基本包的授权时间！"
					} else if (result.status === '40131') {
						errMessage = "当前用户不能使用手机app进行购买！"
					}
					uni.showToast({
						title: errMessage,
						icon: 'none'
					})			      
			    }
			},
			requestWechatPayment: function(content) {
			    var that = this
			    uni.requestPayment({
					provider: 'wxpay',
					timeStamp: content.timestamp,
					nonceStr: content.noncestr,
					package: "prepay_id=" + content.prepayid,
					signType: 'MD5',
					paySign: content.sign,
					success: function(e) {
						that.paySuccess(that,e)
					},
					fail: function(e) {
						that.payFail(that,e)
					},
			    })
			},
			paySuccess: function(that,e) {
				that.payMoneySuccess = true
				that.onClosePayWindow()
			    
			    that.getBuyInfo(0)
			},
			payFail: function(that,e) {
				var Message = ""
			    that.onClosePayWindow()
			    if (e.errMsg.indexOf('cancel')) {
					Message ="支付已取消"
			    } else {
					Message = e.errMsg
			    }
				uni.showToast({
					title: Message,
					icon: 'none'
				})
			}
		}
	}
</script>

<style scoped>
	.section {
		width: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.content {
		width: 95%;
		height: 240rpx;
		border-bottom: 1px solid #e5e5e5;
		display: flex;
		align-items: center;
	}

	.content-left {
		width: 300rpx;
		height: 240rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.content-left image {
		width: 340rpx;
		height: 200rpx;
	}

	.content-right {
		width: 540rpx;
		height: 200rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-around;
		padding-left: 10rpx;
	}

	.content-right-top {
		width: 90%;
		height: 50rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.content-right-top>text {
		font-size: 36rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #000000;
	}

	.give {
		width: 152rpx;
		height: 34rpx;
		background: #FF0000;
		opacity: 1;
		border-radius: 6rpx;
		text-align: center;
		line-height: 34rpx;
		font-size: 20rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
	}

	.content-right>text {
		font-size: 26rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #A9A9A9;
	}

	.content-money {
		width: 90%;
		height: 60rpx;
		display: flex;
		flex-direction: column;
	}

	.content-money-left {
		width: 50%;
		height: 52rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.content-money-left text {
		width: 64rpx;
		height: 34rpx;
		opacity: 1;
		border-radius: 4rpx;
		text-align: center;
		line-height: 34rpx;
		font-size: 22rpx;
		font-family: PingFang SC;
		font-weight: 400;
		background-color: #00B9EF;
		color: #FFFFFF;
	}

	.money {
		width: 152rpx;
		height: 40rpx;
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 400;
		line-height: 40rpx;
		color: #FF1F1F;
		opacity: 1;
	}

	.money1 {
		display: flex;
		/* justify-content: center; */
		align-items: center;
		width: 40%;
		height: 32rpx;
		font-size: 22rpx;
		font-family: PingFang SC;
		font-weight: 400;
		line-height: 32rpx;
		color: #A9A9A9;
		opacity: 1;
	}

	.buynum {
		display: flex;
		/* justify-content: center; */
		align-items: center;
		width: 90%;
		height: 60rpx;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #757575;
	}

	.title {
		width: 100%;
		height: 200rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		background-color: #F1F1F1;

	}

	.title>text {
		width: 100%;
		height: 80rpx;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #333333;
		padding-left: 20rpx;
		background-color: #FFFFFF;
		line-height: 80rpx;
	}

	.title-chose {
		width: 100%;
		height: 80rpx;
		background-color: #FFFFFF;
		display: flex;
		line-height: 80rpx;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #333333;
		padding-left: 20rpx;
	}

	.title-chose-right {
		width: 30%;
		display: flex;
		justify-content: space-around;
	}

	.already {
		width: 100%;
		height: 80rpx;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #333333;
		padding-left: 20rpx;
		background-color: #FFFFFF;
		line-height: 80rpx;
		border-bottom: 2rpx solid #A9A9A9;
	}

	.noprotect {
		width: 100%;
		height: 80rpx;
		font-size: 28rpx;
		color: #333333;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.buycontent {
		width: 90%;
		height: 80rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.buycontent-left {
		font-size: 30rpx;
		color: #333333;
	}

	.buycontent-right {
		font-size: 30rpx;
		color: #ff5500;
	}

	.bottom {
		width: 100%;
		height: 100rpx;
		position: absolute;
		bottom: 0;
		display: flex;
	}

	.bottom-left {
		width: 50%;
		height: 100rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		background-color: #FFFFFF;
	}


	.update-count {
		display: flex;
		
	}

	.add {
		font-size: 34rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #000000;
	}

	.allmoney {
		font-size: 34rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #FF0000;
	}

	.bottom-right {
		width: 50%;
		height: 100rpx;
		line-height: 100rpx;
		text-align: center;
		background-color: #FF0000;
		font-size: 34rpx;
		color: #FFFFFF;
	}


	.reduce {
		width: 60rpx;
		height: 50rpx;
		background: #F1ECE7;
		border-radius: 10rpx;		
		color: #979797;
		font-size: 50rpx;
		line-height: 60rpx;
		text-align: center;
		margin-right: 1rpx;		
	}

	.Add {
		width: 60rpx;
		height: 50rpx;
		background: #F1ECE7;
		border-radius: 10rpx;		
		color: #979797;
		font-size: 40rpx;
		line-height: 60rpx;
		text-align: center;
		margin-left: 0rpx;	
	}

	.cart-count {
		width: 72rpx;
		height: 50rpx;
		background: #F1ECE7;
		border-radius: 10rpx;
		text-align: center;
		line-height: 50rpx;
		margin-left: 6rpx;
		margin-right: 6rpx;
	}
	.paywindow-root {
		width: 100%;
		height: 650rpx;
		background-color: white;
		display: flex;
		flex-direction: column;
		align-items: center;
		position: absolute;
		bottom: 0rpx;
	}
	.paywindow-title{
		width: 100%;
		height: 90rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		background-color:white;
	}
	.paywindow-title-cancel{
		width: 50;
		height: 100%;
		flex: 1;
		display: flex;
		align-items: center;
		//justify-content: center;
	}
	.paywindow-title-text{
		width: 100%;
		height: 100%;
		flex: 2;
		display: flex;
		align-items: center;
		padding-left: 60rpx;
		//justify-content: center;
	}
	.image-cancel{
		width: 50rpx;
		height: 50rpx;
	}
	.paywindow-content{
		width: calc(100% - 40rpx);
		height: 400rpx;		
		display: flex;
		align-items: center;
		flex-direction: column;
	}
	.paywindow-content-price{
		width: 100%;
		height: 90rpx;
		font-size: 50rpx;		
		font-weight: bold;
		flex: 2;
		display: flex;
		justify-content:center;
		align-items: center;
	}	
	.paywindow-content-list{
		width: 100%;
		height: 90rpx;		
		display: flex;
		align-items: center;
		flex-direction: row;
		justify-content: space-between;
	}
	.content-tag{
		margin-left: 10rpx;
		display: flex;
		align-items: center;
	}
	.content-order{		
		display: flex;
		align-items:center;
		justify-content:right;
		padding-left: 60rpx;
	}
	.paywindow-submit{
		width: calc(100% - 40rpx);
		height: 80rpx;
		text-align: center;
		line-height: 80rpx;
		background-color:#00B9EF;
		border-radius: 10rpx;
		margin-top: 50rpx;
		color: #555555;
	}
	.paywindow-submit::after{
		border: none;
	}
	.paywindow-button-hover {
	  background-color: rgba(0,185,239,0.7);
	} 
</style>
